<%inherit file="/admin/account/base.html" />

<%block name="innav">
<li><a href="${ reverse_url('admin:group') }">${ _("Group") }</a></li>
</%block>

<%block name="submain">

<div class="manage-content">
  <a class="blue-submit" href="${ reverse_url('admin:group') }?action=add">${ _("Create New Group") }</a>
  <a class="red-submit" href="${ reverse_url('admin:user') }?gid=0">${ _("Users Have No Group") }</a>
</div>

<p class="subtitle">${ _("Total Groups: ") } ${ len(GROUP_LIST) }</p>

<div>
  <table class="table table-bordered table-striped">
    <thead>
      <tr>
    <th>${ _("ID") }</th>
    <th>${ _("Name") }</th>
    <th>${ _("Users") }</th>
    <th></th>
      </tr>
    </thead>
    <tbody>
      % for G in GROUP_LIST:
      <tr>
        <td>${ G.id }</td>
        <td><a href="${ reverse_url('admin:group') }?id=${ G.id }" target="_blank">${ G.name }</a></td>
    <td>
      % if G.users:
      <a href="${ reverse_url('admin:user') }?gid=${ G.id }" target="_blank">${ len(G.users) }</a>
      % endif
    </td>

    <td>
      <a href="${ reverse_url('admin:group') }?id=${ G.id }&action=edit">${ _("Edit") }</a>
      <a href="${ reverse_url('admin:account:group_merge') }?id=${ G.id }">${ _("Merge Group") }</a>
      % if G.islocked:
      ${ _("locked") }
      % else:
      <a href="${ reverse_url('admin:group') }?id=${ G.id }&action=delete">${ _("Delete") }</a>
      % endif
    </td>
      </tr>
      % endfor
    </tbody>
  </table>
</div>


</%block>
